package cn.colins.raft.rpc.handler.chanel;


import cn.colins.raft.enity.ClientRequest;
import cn.colins.raft.enity.LogIndexPull;
import cn.colins.raft.node.RaftNodeService;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description  日志拉取请求
 * @Author czl
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2023/6/12
 */
public class LogPullRequestHandler extends SimpleChannelInboundHandler<LogIndexPull> {
    private static final Logger log = LoggerFactory.getLogger(LogPullRequestHandler.class);

    @Override
    public void channelActive(ChannelHandlerContext context) throws Exception {
        Channel channel = context.channel();
    }

    @Override
    protected void channelRead0(ChannelHandlerContext context, LogIndexPull rpcResponse) throws Exception {
        // 日志拉取请求
        RaftNodeService.logPullRequestHandler(rpcResponse,context.channel());
    }
}
